package com.netflexitysolutions.amazonws.ec2;

import java.util.HashMap;
import java.util.Map;

public enum ImageType {
	
	MACHINE("machine"), KERNEL("kernel"), RAMDISK("ramdisk");
	
	private static Map<String, ImageType> typeByName = new HashMap<String, ImageType>();
	
	static {
		ImageType[] types = ImageType.values();
		for (ImageType type : types) {
			typeByName.put(type.getName(), type);
		}
	}
	
	public static ImageType imageTypeForName(String name) {
		return typeByName.get(name);
	}
	
	private String name;
	
	private ImageType(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
}
